#include <stdio.h>
#include <string.h>
#include "netfn_0x06_cmd_0x38.h"
#include "ipmi.h"
#include "ipmi_netfn.h"

uint16 GetChannelAuthenticationCapabilities(uint8* request_data, uint16 request_data_size, uint8* response_data)
{
    printf("%s\n",__func__);
    GetChannelAuthenticationCapabilitiesReq* req = (GetChannelAuthenticationCapabilitiesReq*)request_data;
    GetChannelAuthenticationCapabilitiesRes* res = (GetChannelAuthenticationCapabilitiesRes*)response_data;
    res->CompletionCode = CC_NORMALLY;
    uint16 response_data_size = sizeof(GetChannelAuthenticationCapabilitiesRes);

    uint8 ChannelNumber = req->ChannelNumber & 0x0F;
    uint8 isIPMI20 = ((req->ChannelNumber & 0x80) >> 7);

    res->ChannelNumber = CHANNEL_LAN;
    res->AuthenticationTypeSupport = 0x0001;
    res->ExtendedCapabilities = 0x01;
    memset(&res->OEMID, 0, sizeof(res->OEMID));
    res->OEMauxiliarydata = 0x00;

    return response_data_size;
}

void init_command(cmd_assigments_t* cmd_assigments)
{
    cmd_assigments->privilege = 0x02;
    cmd_assigments->channel = 0x01;
    cmd_assigments->command_entrance = &GetChannelAuthenticationCapabilities;
}
